const fs = require("fs");

function readfileAndWrite (content, filename) {
  const data = new Uint8Array(Buffer.from(content));
  fs.writeFile(filename, data, (err) => {
    if (err) throw err;
    console.log('文件已被保存');
  });
}

module.exports = readfileAndWrite